@(loginForm: Form[Login])(redirect: String)(implicit lang: Lang)

@import helper._
@implicitFieldConstructor = @{ FieldConstructor(bootstrap.render) }

@main("The Cult Cinema Inc. Login "){

	<section style="padding-top:120px">
				<div class="row">
					<div class="span12">
						<ul class="breadcrumb">
							<li><a href="@routes.Application.index(lang.code)">@Messages("home")(lang)</a> <span class="divider">/</span></li>
		        			<li class="active">@Messages("login")(lang)</li>
		        		</ul>
					</div>
				</div>

				@if(loginForm.hasErrors) {
					<div class="row">
						<div class="span12">
				    	    <div class="alert-error alert alert-block">
				    	    	<h4 class="alert-heading">@Messages("error")(lang)
					    	    	@if(loginForm.hasGlobalErrors) { # @Messages(loginForm.globalError.message)(lang) }
				    	    	</h4>
					    	</div>
						</div>
					</div>
				}

				@if(flash.contains("error")) {
					<div class="row">
						<div class="span12">
					    	<div class="alert-error alert alert-block">
					    		<h4 class="alert-heading">
								ERROR # @flash.get("error")
								</h4>
							</div>
						</div>
					</div>
				}

				<div class="row">
			    	<div class="span8">
					    @helper.form(action = routes.Application.authenticate, 'class -> "form-horizontal well") {

					        <fieldset>
					            <legend><i class="icon-user"></i> @Messages("login.title")(lang)</legend>

					            @inputText(
					                loginForm("username"),
					                '_label -> Messages("login.username")(lang),
					                '_help -> "Please choose a valid email.",
					                '_error -> loginForm.globalError
					            )

					            @inputPassword(
					                loginForm("password"),
					                '_label -> Messages("login.password")(lang),
					                '_help -> "A password must be at least 6 characters. "
					            )

								@if(redirect != null) {
									<input type="hidden" name="redirect" value="@redirect">
								}
								
								<input type="hidden" name="lang" value="@lang.code">

					        </fieldset>

					        <div class="form-actions">
					        	<button type="submit" class="btn btn-primary">@Messages("login")(lang)</button>
					        	<button type="reset" class="btn">@Messages("login.reset")(lang)</button>
					        </div>
					    }

					</div>
					<div class="span4">
						<div class="well">
							<h4><i class="icon-group"></i> @Messages("register.login")(lang)</h4>
							<p>@Messages("register.benefit")(lang) :
								<ol>
									<li>@Messages("register.benefit.item1")(lang)</li>
									<li>@Messages("register.benefit.item2")(lang)</li>
									<li>@Messages("register.benefit.item3")(lang)</li>
								</ol>
							</p>
							<br />
							<h5>@Messages("register.join")(lang)</h5>
							<a href="@routes.Member.join(lang.code)" class="btn btn-block btn-large btn-success">@Messages("register")(lang)</a>
						</div>
			    </div>
			</section>

}(lang)
